@extends('layouts.template')

@section('title', '管理后台')

@section('content')

    <script>
        var selectedMenu = 'order/all';
        var selectedTitle = '订单详情';

        $(function(){

            var form = new Vue({
                el:'#contentpanel',
                data:{
                },
                computed:{
                },
                mounted:function(){
                },
                watch: {
                },
                methods:{
                },
                components:{
                }
            });

            window.showImage = function(source)
            {
                $("#image").find(".modal-content").html("<image src='"+source+"' width='100%' />");
                $("#image").modal('show');
            }

            $("#image").on("hidden.bs.modal", function() {
                $(this).removeData("bs.modal");
                $(this).find('.modal-content').empty();
            });

        });

    </script>

    <div class="contentpanel" id="contentpanel">

        <div class="row">
            <div class="col-md-12">

                @component('order.layouts.showHeader',['option'=>'status','order'=>$order])
                @endcomponent

                <!-- Tab panes -->
                <div class="tab-content mb30">
                    <div class="tab-pane active">

                        <div class="panel panel-default">
                            <div class="panel-body nopadding">
                                <form class="form-bordered">

                                    @if ($order->status->appoint_time)
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><strong><u>预约客户</u></strong></label>
                                            <div class="col-sm-9">
                                                {{$order->status->appoint_time}}&nbsp;&nbsp;师傅已预约客户&nbsp;&nbsp;上门服务时间&nbsp;&nbsp;{{$order->status->door_time_period_text}}
                                            </div>
                                        </div><!-- form-group -->
                                    @endif

                                    @if ($order->status->deliver_time)
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><strong><u>物流提货</u></strong></label>
                                            <div class="col-sm-9">
                                                {{$order->status->deliver_time}}&nbsp;&nbsp;师傅到达物流点提货&nbsp;&nbsp;物流签收状态&nbsp;&nbsp;{{$order->status->deliver_except ? "提货异常({$order->status->deliver_except})" : '正常签收'}}
                                            </div>
                                            <div class="col-sm-9">
                                                @foreach ($order->status->deliver_imgs_url as $img)
                                                    <a onclick="showImage('{{$img}}')" href="javascript:void(0)"><img width="150" src="{{$img}}"></a>
                                                @endforeach
                                            </div>
                                        </div><!-- form-group -->
                                    @endif

                                    @if ($order->status->finish_time)
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label"><strong><u>完成服务</u></strong></label>
                                            <div class="col-sm-9">
                                                {{$order->status->finish_time}}&nbsp;&nbsp;师傅操作完成服务<br />
                                                @if ($order->status->finish_message)
                                                    留言：{{$order->status->finish_message}}
                                                @endif
                                            </div>
                                            <div class="col-sm-9">
                                                完成的家具照片<br />
                                                @foreach ($order->status->finish_imgs_url as $img)
                                                    <a onclick="showImage('{{$img}}')" href="javascript:void(0)"><img width="150" src="{{$img}}"></a>
                                                @endforeach
                                            </div>
                                            @if ($order->status->tmall_check_img)
                                                <div class="col-sm-9">
                                                    喵师傅成功核销截图<br />
                                                    <a onclick="showImage('{{$order->status->tmall_check_img_url}}')" href="javascript:void(0)"><img width="150" src="{{$order->status->tmall_check_img_url}}"></a>
                                                </div>
                                            @endif
                                            <div class="col-sm-9">
                                                客户签收单照片<br />
                                                <a onclick="showImage('{{$order->status->finish_ticket_img_url}}')" href="javascript:void(0)"><img width="150" src="{{$order->status->finish_ticket_img_url}}"></a>
                                            </div>
                                        </div><!-- form-group -->
                                    @endif

                                </form>
                            </div><!-- panel-body -->
                        </div>

                    </div><!-- tab-pane -->
                </div><!-- tab-content -->

            </div><!-- col-md-6 -->
        </div>
    </div><!-- contentpanel -->

    <div class="modal fade" id="image" tabindex="-1" role="dialog" data-keyboard="false">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
            </div>
        </div>
    </div>

@endsection

